
from amplitude.emailer import Emailer

class User(Emailer):
    
    def signup_mail(self, user):
        """returns a message that serves as signup confirmation for this user."""
        from email.mime.text import MIMEText
        msg = MIMEText(self.render('/user/signup_mail.txt.mako', user=user))
        msg['From'] = self.config.Email.fromaddr
        msg['To'] = user.email
        msg['Subject'] = "[%s] Signup" % self.config.Site.name
        return msg
        
    def new_pwd_mail(self, user):
        from email.mime.text import MIMEText
        msg = MIMEText(self.render('/user/new_pwd_mail.txt.mako', user=user))
        msg['From'] = self.config.Email.fromaddr
        msg['To'] = user.email
        msg['Subject'] = "[%s] New Password" % self.config.Site.name
        return msg
        